<!--#include file="/admin/include/head.html"-->
<body class="login-layout" background="/admin/assets/images/background.jpg" style="background-size:cover">
<div class="main-container" style="margin-top: 10%;">
    <div class="main-content">
        <div class="row">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="login-container">
                    <div class="center">
                        <h1>
                            <i class="icon-leaf green"></i>
                            <span class="red">个人博客</span>
                            <span class="white">后台管理系统</span>
                        </h1>
                        <h4 class="blue">&copy; 皮卡皮卡丘</h4>
                    </div>

                    <div class="space-6"></div>

                    <div class="position-relative">
                        <div id="login-box" class="login-box visible widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header blue lighter bigger">
                                        <i class="icon-coffee green"></i>
                                        请输入账号密码
                                    </h4>

                                    <div class="space-6"></div>
                                    <form>
                                        <fieldset>
                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control" id="username" placeholder="用户名"/>
															<i class="icon-user"></i>
														</span>
                                            </label>

                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control" id="password" placeholder="密码"/>
															<i class="icon-lock"></i>
														</span>
                                            </label>

                                            <div class="space"></div>

                                            <div class="clearfix">
                                                <label class="inline">
                                                    <input type="checkbox" id="rememberMe" class="ace"/>
                                                    <span class="lbl"> 记住密码</span>
                                                </label>

                                                <button type="button" class="width-35 pull-right btn btn-sm btn-primary" onclick="submitLogin()">
                                                    <i class="icon-key"></i>
                                                    登录
                                                </button>
                                            </div>
                                            <div class="space-4"></div>
                                        </fieldset>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    document.onkeydown = function (event) {
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if (e && e.keyCode === 13) { // enter 键
            submitLogin();
        }
    };

    function submitLogin() {
        if ($("#username").val() === "" || $("#password").val() === "") {
            alert(data.error);
        }
        var para = {
            username: $("#username").val(),
            password: $("#password").val(),
            rememberMe: $("rememberMe").val()
        };
        loadGetServer("/manager/login", para, function (data) {
            if (data.code !== 0) {
                alert(data.error);
            } else {
                window.location.href = "/admin/index.html";
            }
        })

    }
</script>
</body>
</html>
